<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%-- 引入页面头 --%>
<%@ include file="/pageHead.jsp"%>
<form name="form1" id="form1" action="${systemctx}/sample/saveSample.web" method="post">
	<input type="hidden" value="${agencylevelcode}" id="agencylevelcode" name="agencylevelcode">
	<div class="pageMain">
		<div class="pageTitle">
			<%=MessageResourcesUtils.getMessage(request, "systemmanage.bascsetting.title")%>
			<span></span>
			<%=MessageResourcesUtils.getMessage(request, "systemmanage.userduty.title.set") %>
			<span></span>
			<%=MessageResourcesUtils.getMessage(request, "systemmanage.userduty.title.set.title") %>
		</div>
		<div class="pageBody">
			<div class="form-group">
				<ul>
					<li>
						<i></i>
						<label>
							<%=MessageResourcesUtils.getMessage(request, "systemtmanage.user.column.username")%>
						</label>
						<span><input type="text" id="username" name="username"/></span> 
					</li>
					<li>
						<i></i>
						<label>
							<%=MessageResourcesUtils.getMessage(request,"systemmanage.userduty.column.postCheckStatus")%>
						</label>
						<span><select name="poststatus" id="poststatus"></select></span> 
					</li>
				</ul>
			</div>	
		</div>
		<div class="button-group">
			<input type="button" class="btn btn-default" id="butQuery" name="butQuery" value="<%=MessageResourcesUtils.getMessage(request, "common.button.query") %>" />
		</div>
		<table>
			<tbody>
				<tr>
					<td>
						<table id="datagrid"></table>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
	
</form>
<script type="text/javascript">
	$(document).ready(function(){
		$("#poststatus").selectutil({
			optModel : <%=SysConstant.Relevance.getUserCheckModelJSONString(true,false)%>,
			optDefault : ''
		});
		
		$('#datagrid').issdatagrid({
			formid : 'form1',
			title : '<%=MessageResourcesUtils.getMessage(request,"systemmanage.userduty.title.set")%>',
			width : 'auto',
			nowrap : true,
			autoRowHeight : false,
			singleSelect : true,
			striped : true,
			url : '${systemctx}/systemmanage/userDuty/user/getUserListJson.json',
			sortName: 'modifytime',
			sortOrder: 'desc',
			remoteSort : true,
			idField : 'id',
			pagination : true,
			rownumbers : true,
			showFooter : true,
			queryParams:$('#form1').serializeObject(),
			frozenColumns :[[
				{title : '<%=MessageResourcesUtils.getMessage(request,"systemtmanage.user.column.userno")%>',field : 'userno',sortable : true,align : 'left',width:140,formatter:function(value,row,index){
					 return "<a href=\"javascript:void(0)\" onclick=\"view('"+row.id+"')\">"+value+"</a>"
				}},
				{title : '<%=MessageResourcesUtils.getMessage(request,"systemtmanage.user.column.loginname")%>',field : 'loginname',sortable : true,align : 'left',width:140},
				{title : '<%=MessageResourcesUtils.getMessage(request,"systemtmanage.user.column.username")%>',field : 'username',sortable : true,align : 'left',width:140,formatter:function(value,row,index){
					return substringInfo(value,25);
				}}
			]],
			columns : [[ 
			  	/* {field:'ck', checkbox:true}, */
	            {title : '<%=MessageResourcesUtils.getMessage(request,"systemtmanage.user.column.validstart")%>',field : 'validstart',sortable : true,align : 'center',width:100},
	            {title : '<%=MessageResourcesUtils.getMessage(request,"systemtmanage.user.column.validend")%>',field : 'validend',sortable : true,align : 'center',width:100},
	            {title : '<%=MessageResourcesUtils.getMessage(request,"systemmanage.userduty.user.status")%>',field : 'checkstatus',sortable : true,align : 'center',width:100},
	            {title : '<%=MessageResourcesUtils.getMessage(request,"systemmanage.userduty.column.postCheckStatus")%>',field : 'poststatus',sortable : true,width : 120,align : 'center'},
	            {field : 'id',hidden:true}
	        ]],
			onLoadSuccess : function(data) {

			}
		});
		$('#butQuery').click(function() {
			$('#datagrid').datagrid('load',$('#form1').serializeObject());
		});
	});

	function substringInfo(content,length){
		if(content != '' && content != undefined){
			if(content.length > length){
				content = content.substring(0,length);
			}
		}
		return content;
	}
	function view(id){
		$(this).isswindow({
			noheader : true,
			url : '${systemctx}/systemmanage/userDuty/user/toDutyList.web?id='+id
		});
	}
</script>
<%-- 引入页面尾 --%>
<%@ include file="/pageFloor.jsp"%>